package com.hzdl.library.service.impl;

import com.hzdl.library.dao.UserDao;
import com.hzdl.library.dao.impl.UserDaoImpl;
import com.hzdl.library.domain.LendList;
import com.hzdl.library.domain.ReaderInfo;
import com.hzdl.library.service.UserService;

import java.util.List;


//姚奇
public class UserServiceImpl implements UserService {
    UserDao userDao=new UserDaoImpl();
    //借书
    @Override
    public Integer lend(String name, Integer readerId) {
        return userDao.lend(name,readerId);
    }
    //还书
    @Override
    public Integer returnBook(Integer book_id) {

        return userDao.returnBook(book_id);
    }
    //查询日志
    @Override
    public List<LendList> lendRecord(String text, Integer index, int rows) {
        return userDao.lendRecord(text,index,rows);
    }
    //判断借还是还
    @Override
    public Integer judge(String name) {
        return userDao.judge(name);
    }
    //计算总条数
    @Override
    public Integer findCount(String text) {
        return userDao.findCount(text);
    }

    @Override
    public void deleteOne(int sernum) {
        userDao.deleteOne(sernum);
    }

    @Override
    public List<LendList> findLog(Integer reader_id) {
        return userDao.findLog(reader_id);
    }

    @Override
    public void updateReader(ReaderInfo readerInfo) {
        userDao.updateReader(readerInfo);
    }

    @Override
    public List<ReaderInfo> selectAllReader() {

        return userDao.selectAllReader();
    }

    @Override
    public void deleteReader(String readerId) {
        userDao.deleteReader(readerId);
    }

    @Override
    public List<LendList> downLoad() {
        return userDao.downLoad();
    }
}
